<?php
namespace app\addons\controller;
// use app\index\
class Message extends Base
{
    public function index()
    {
        $fid=request()->param('fid');
        // print_r($cid);     
        $message=db("plugin_message");
        $where['status']=1;

        $count=$message->where($where)->count();
        $data=$message->where($where)->order("id desc")->select();
        
        $this->assign("fname","在线留言");
        $this->assign("mess",$data);
        $this->assign("count",$count);
        return view('index');
    }
    public function index_del(){
        $id=$_GET['id'];
        $res=db("article")->delete($id);
        if($res){
            $mess['code']=1;
            $mess['msg']="删除成功";
        }else{
            $mess['code']=0;
            $mess['msg']="删除失败";
        }       // print_r($data);exit;
        return json_encode($mess);
    }    
}
